﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using nwind;

namespace DemoForLinq.Chapter1
{
    class Demo1_6_UserVarKeyword
    {
        static void Main(string[] args)
        {
            Northwind db = new Northwind(@"Data Source=.;Initial Catalog=Northwind;Integrated Security=true");
            IEnumerable<Order> orders = db.Customers
                .Where(c => c.Country == "USA" && c.Region == "WA")
                .SelectMany(c => c.Orders);
            Console.WriteLine(orders.GetType());
            foreach (var order in orders)
            {
                Console.WriteLine("{0} - {1} - {2}",order.OrderDate,order.OrderID,order.ShipName);
            }
        }
    }
}
